
    window.onload = function() {
      // 定时器，每个1秒执行1次
      setInterval(() => {
        var dt = new Date()
        var HH = dt.getHours()
        var mm = dt.getMinutes()
        var ss = dt.getSeconds()
       

        var h = document.getElementById('HH')
        var m = document.getElementById('mm')
        var s = document.getElementById('ss')

        
        h.innerHTML = toggle(HH)
        m.innerHTML = toggle(mm)
        s.innerHTML = toggle(ss)        
      }, 1000);

      // 补零函数
      function toggle(val) {
        return val < 10 ? '0' + val : val;
      }
    }
  